import { translate } from '@docusaurus/Translate';
import React from 'react';

export type TagType =
  | 'ide'
  | 'git'
  | 'database'
  | 'container'
  | 'editor'
  | 'tool'
  | 'api'
  | 'java'
  | 'python'
  | 'nodejs';

export type User = {
  key?: number;
  title: string;
  description: string;
  preview: string | null;
  website: string;
  downloads: {
    windows?: string;
    mac?: string;
    linux?: string;
  };
  tags: TagType[];
  source?: {
    name?: string;
    url?: string;
  };
};

const sourceNameDefault = "AtomGit开发者";

export const Tags = {
  ide: {
    label: translate({message: 'IDE'}),
    description: translate({
      message: '集成开发环境',
    }),
    color: '#e9669e',
  },
  git: {
    label: translate({message: 'Git工具'}),
    description: translate({message: 'Git相关工具'}),
    color: '#39ca30',
  },
  database: {
    label: translate({message: '数据库工具'}),
    description: translate({message: '数据库管理和开发工具'}),
    color: '#dfd545',
  },
  container: {
    label: translate({message: '容器工具'}),
    description: translate({message: '容器和虚拟化工具'}),
    color: '#a44fb7',
  },
  editor: {
    label: translate({message: '编辑器'}),
    description: translate({message: '代码编辑器'}),
    color: '#4267b2',
  },
  tool: {
    label: translate({message: '通用工具'}),
    description: translate({message: '其他开发工具'}),
    color: '#25c2a0',
  },
  api: {
    label: translate({message: 'API工具'}),
    description: translate({message: 'API开发和测试工具'}),
    color: '#ff6b6b',
  },
  java: {
    label: translate({message: 'Java工具'}),
    description: translate({message: 'Java开发相关工具'}),
    color: '#007396',
  },
  python: {
    label: translate({message: 'Python工具'}),
    description: translate({message: 'Python开发相关工具'}),
    color: '#3776ab',
  },
  nodejs: {
    label: translate({message: 'Node.js工具'}),
    description: translate({message: 'Node.js开发相关工具'}),
    color: '#339933',
  },
};

export const TagList = Object.keys(Tags) as TagType[];

export const Users: User[] = [
  {
    key: 0,
    title: 'AtomGit MCP Server',
    description: 'AtomGit MCP 服务器是专门为 AtomGit 开源协作平台的模型上下文(MCP) 服务的实现。提供了一系列方法，允许 AI 管理 AtomGit 开源协作平台的仓库、issues、pull requests、branch、label等。',
    preview: 'https://file.atomgit.com/uploads/assets/MCP.png', 
    website: 'https://atomgit.com/atomgit-open-source-ecosystem/atomgit-mcp-server',
    tags: ['tool', 'git'],
    downloads: {
      windows: 'https://atomgit.com/atomgit-open-source-ecosystem/atomgit-mcp-server',
      mac: 'https://atomgit.com/atomgit-open-source-ecosystem/atomgit-mcp-server',
      linux: 'https://atomgit.com/atomgit-open-source-ecosystem/atomgit-mcp-server',
    },
  },
  {
    key: 1,
    title: 'AtomGit Desktop',
    description: 'AtomGit是开放原子开源基金会旗下的代码托管平台客户端，提供本地Git仓库管理及研发辅助工具，支持Windows和macOS系统',
    preview: 'https://file.atomgit.com/uploads/assets/atom.png',
    website: 'https://atomgit.com',
    downloads: {
      windows: 'https://file.linksaas.pro/release/atomgit/windows-x86_64/AtomGit_1.0.7_x64_zh-CN.msi',
      mac: 'https://file.linksaas.pro/release/atomgit/darwin/1.0.7/AtomGit.app.tar.gz',
    },
    tags: ['git', 'tool']
  },
  {
    key: 2,
    title: 'Git',
    description: '分布式版本控制系统',
    preview: 'https://git-scm.com/images/logos/downloads/Git-Icon-1788C.png',
    website: 'https://git-scm.com/',
    downloads: {
      windows: 'https://atomgit.com/atomgit_operate/quick_link_software/tree/master/git',
    },
    tags: ['git']
  },
  {
    key: 3,
    title: 'TortoiseGit',
    description: '基于TortoiseSVN开发的Git图形化客户端，与Windows资源管理器深度集成。支持32位、64位和ARM64架构，并提供中文语言包',
    preview: '/img/devtools/tortoisegit.jpg',
    website: 'https://tortoisegit.org/',
    downloads: {
      windows: 'https://download.tortoisegit.org/tgit/2.17.0.0/TortoiseGit-2.17.0.2-64bit.msi',
    },
    tags: ['git', 'tool']
  },
  {
    key: 4,
    title: 'Visual Studio Code',
    description: '轻量级但功能强大的源代码编辑器',
    preview: 'https://code.visualstudio.com/assets/images/code-stable.png',
    website: 'https://code.visualstudio.com/',
    downloads: {
      windows: 'https://vscode.cdn.azure.cn/stable/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e/VSCodeUserSetup-x64-1.84.2.exe',
      mac: 'https://vscode.cdn.azure.cn/stable/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e/VSCode-darwin-universal.zip',
      linux: 'https://vscode.cdn.azure.cn/stable/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e/code_1.84.2-1699528352_amd64.deb',
    },
    tags: ['editor', 'ide'],
  },
  {
    key: 5,
    title: 'Eclipse',
    description: '流行的开源集成开发环境',
    preview: 'https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-foundation-grey-orange.svg',
    website: 'https://www.eclipse.org/',
    downloads: {
      windows: 'https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2023-12/R/eclipse-java-2023-12-R-win32-x86_64.zip',
      mac: 'https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2023-12/R/eclipse-java-2023-12-R-macosx-cocoa-x86_64.dmg',
      linux: 'https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2023-12/R/eclipse-java-2023-12-R-linux-gtk-x86_64.tar.gz',
    },
    tags: ['ide', 'java'],
  },
  {
    key: 6,
    title: 'Postman',
    description: '流行的API开发和测试工具',
    preview: 'https://cdn.worldvectorlogo.com/logos/postman.svg',
    website: 'https://www.postman.com/',
    downloads: {
      windows: 'https://dl.pstmn.io/download/latest/win64',
      mac: 'https://dl.pstmn.io/download/latest/osx',
      linux: 'https://dl.pstmn.io/download/latest/linux64',
    },
    tags: ['api', 'tool'],
  },
  {
    key: 7,
    title: 'MySQL Workbench',
    description: 'MySQL官方图形化管理工具',
    preview: 'https://labs.mysql.com/common/logos/mysql-logo.svg',
    website: 'https://www.mysql.com/products/workbench/',
    downloads: {
      windows: 'https://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-8.0.34-winx64.msi',
      mac: 'https://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-8.0.34-macos-x86_64.dmg',
      linux: 'https://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-8.0.34-1.el8.x86_64.rpm',
    },
    tags: ['database', 'tool'],
  },
  {
    key: 8,
    title: 'Node.js',
    description: 'JavaScript运行时环境',
    preview: 'https://nodejs.org/static/images/logo.svg',
    website: 'https://nodejs.org/',
    downloads: {
      windows: 'https://nodejs.org/dist/v20.10.0/node-v20.10.0-x64.msi',
      mac: 'https://nodejs.org/dist/v20.10.0/node-v20.10.0.pkg',
      linux: 'https://nodejs.org/dist/v20.10.0/node-v20.10.0-linux-x64.tar.xz',
    },
    tags: ['nodejs', 'tool'],
  },
  {
    key: 9,
    title: 'Python',
    description: 'Python编程语言解释器',
    preview: 'https://www.python.org/static/community_logos/python-logo.png',
    website: 'https://www.python.org/',
    downloads: {
      windows: 'https://www.python.org/ftp/python/3.12.1/python-3.12.1-amd64.exe',
      mac: 'https://www.python.org/ftp/python/3.12.1/python-3.12.1-macos11.pkg',
    },
    tags: ['python', 'tool'],
  },
  {
    key: 10,
    title: 'Maven',
    description: 'Java项目构建和依赖管理工具',
    preview: 'https://maven.apache.org/images/maven-logo-black-on-white.png',
    website: 'https://maven.apache.org/',
    downloads: {
      windows: 'https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.zip',
      mac: 'https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz',
      linux: 'https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz',
    },
    tags: ['java', 'tool'],
  },
  {
    key: 11,
    title: 'Gradle',
    description: '灵活的项目自动化构建工具',
    preview: 'https://gradle.org/images/gradle-knowledge-graph-logo.png',
    website: 'https://gradle.org/',
    downloads: {
      windows: 'https://services.gradle.org/distributions/gradle-8.5-bin.zip',
      mac: 'https://services.gradle.org/distributions/gradle-8.5-bin.zip',
      linux: 'https://services.gradle.org/distributions/gradle-8.5-bin.zip',
    },
    tags: ['java', 'tool'],
  },
  {
    key: 12,
    title: 'DBeaver',
    description: '通用数据库管理工具',
    preview: 'https://dbeaver.io/wp-content/uploads/2015/09/beaver-head.png',
    website: 'https://dbeaver.io/',
    downloads: {
      windows: 'https://dbeaver.io/files/dbeaver-ce-latest-x86_64-setup.exe',
      mac: 'https://dbeaver.io/files/dbeaver-ce-latest-macos.dmg',
      linux: 'https://dbeaver.io/files/dbeaver-ce-latest-linux.gtk.x86_64.tar.gz',
    },
    tags: ['database', 'tool'],
  },
  {
    key: 13,
    title: 'Insomnia',
    description: '现代化的API开发和测试工具',
    preview: 'https://insomnia.rest/images/insomnia-logo.svg',
    website: 'https://insomnia.rest/',
    downloads: {
      windows: 'https://github.com/Kong/insomnia/releases/download/core%408.5.1/Insomnia.Core-8.5.1.exe',
      mac: 'https://github.com/Kong/insomnia/releases/download/core%408.5.1/Insomnia.Core-8.5.1.dmg',
      linux: 'https://github.com/Kong/insomnia/releases/download/core%408.5.1/Insomnia.Core-8.5.1.AppImage',
    },
    tags: ['api', 'tool'],
  },
  {
    key: 14,
    title: 'SourceTree',
    description: '免费的Git图形化客户端',
    preview: 'https://www.sourcetreeapp.com/dam/jcr:f32681c1-355d-4806-b29c-319b0c6ecb06/sourcetree-hero-icon.svg',
    website: 'https://www.sourcetreeapp.com/',
    downloads: {
      windows: 'https://product-downloads.atlassian.com/software/sourcetree/windows/ga/SourceTreeSetup-3.4.12.exe',
      mac: 'https://product-downloads.atlassian.com/software/sourcetree/ga/Sourcetree_4.2.3_250.zip',
    },
    tags: ['git', 'tool']
  },
  {
    key: 15,
    title: 'Anaconda',
    description: 'Python和R语言的科学计算平台',
    preview: 'https://www.anaconda.com/wp-content/uploads/2022/12/anaconda_secondary_logo.svg',
    website: 'https://www.anaconda.com/',
    downloads: {
      windows: 'https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Windows-x86_64.exe',
      mac: 'https://repo.anaconda.com/archive/Anaconda3-2023.09-0-MacOSX-x86_64.pkg',
      linux: 'https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh',
    },
    tags: ['python', 'tool'],
  },
  {
    key: 16,
    title: 'MongoDB Compass',
    description: 'MongoDB官方图形化管理工具',
    preview: 'https://cdn.worldvectorlogo.com/logos/mongodb-icon-1.svg',
    website: 'https://www.mongodb.com/products/compass',
    downloads: {
      windows: 'https://downloads.mongodb.com/compass/mongodb-compass-1.40.4-win32-x64.exe',
      mac: 'https://downloads.mongodb.com/compass/mongodb-compass-1.40.4-darwin-x64.dmg',
      linux: 'https://downloads.mongodb.com/compass/mongodb-compass_1.40.4_amd64.deb',
    },
    tags: ['database', 'tool'],
  },
  {
    key: 18,
    title: '腾讯自研Git客户端',
    description: '让每个人都可以轻松使用Git。便捷的大文件管理，内置LFS模版，支持超大文件无损下载。',
    preview: '/img/devtools/tencent-ugit.png',
    website: 'https://ugit.qq.com/zh/',
    downloads: {
      windows: 'https://ugit.qq.com/downloads/ugit_public/UGitSetup.exe',
      mac: 'https://ugit.qq.com/downloads/ugit_public/UGit-arm64-5.30.2.dmg',
    },
    tags: ['git', 'tool'],
    source: {
      name: sourceNameDefault,
      url: "https://atomgit.com/atomgit_operate/feedback/issues/1253",
    }
  },
  {
    key: 19,
    title: 'SoapUI',
    description: 'API接口测试工具，包含REST接口，与Web Service接口，另外还可以反向生成Web Service的JAVA客户端文件。',
    preview: '/img/devtools/SoapUI.png',
    website: 'https://www.soapui.org/',
    downloads: {
      windows: 'https://dl.eviware.com/soapuios/5.8.0/SoapUI-x64-5.8.0.exe',
      mac: 'https://dl.eviware.com/soapuios/5.8.0/SoapUI-arm64-5.8.0.dmg',
      linux: 'https://dl.eviware.com/soapuios/5.8.0/SoapUI-5.8.0-linux-bin.tar.gz',
    },
    tags: ['api', 'tool'],
    source: {
      name: sourceNameDefault,
      url: "https://atomgit.com/atomgit_operate/feedback/issues/1406",
    }
  },
  {
    key: 20,
    title: 'jEdit',
    description: '文本编辑器',
    preview: '/img/devtools/jEdit.png',
    website: 'https://jedit.org/',
    downloads: {
      windows: 'https://jedit.org/index.php?page=download&platform=mac#instructions',
      mac: 'https://jedit.org/index.php?page=download&platform=windows#instructions',
      linux: 'https://jedit.org/index.php?page=download&platform=unix#instructions',
    },
    tags: ['editor', 'tool'],
    source: {
      name: sourceNameDefault,
      url: "https://atomgit.com/atomgit_operate/feedback/issues/1407",
    }
  },
  {
    key: 21,
    title: 'Apifox',
    description: '国产API 设计、开发、测试一体化协作平台.',
    preview: '/img/devtools/apifox.svg',
    website: 'https://apifox.com/',
    downloads: {
      windows: 'https://file-assets.apifox.com/download/Apifox-windows-latest.zip',
      mac: 'https://file-assets.apifox.com/download/Apifox-macOS-arm64-latest.zip',
      linux: 'https://file-assets.apifox.com/download/Apifox-linux-manual-latest.tar.gz',
    },
    tags: ['api', 'tool'],
    source: {
      name: sourceNameDefault,
      url: "https://atomgit.com/atomgit_operate/feedback/issues/1941",
    }
  }
];

export const sortedUsers = Users.sort((a, b) =>
  (a.key || 0) - (b.key || 0)
);

// 隐藏的链接地址
const TOOLS_FEEDBACK_URL = 'https://atomgit.com/atomgit_operate/feedback/issues/create?name=6.devtools&dirType=1&page=issueTemplate';
const COPYRIGHT_FEEDBACK_URL = 'https://atomgit.com/atomgit_operate/feedback/issues/create?name=5.Copyright&dirType=1&page=issueTemplate';

// 推荐工具提示
export const RecommendationNotice = (
  <div style={{
    textAlign: 'center',
    marginBottom: '2rem',
    color: 'var(--ifm-color-emphasis-700)',
  }}>
    如果你有推荐的工具，请<a href={TOOLS_FEEDBACK_URL} target="_blank" rel="noopener noreferrer">反馈给我们</a>。
  </div>
);

// 版权声明
export const CopyrightNotice = (
  <>
    本页面展示的所有软件名称、Logo、商标均为其各自所有者的知识产权。如有侵权，请
    <a href={COPYRIGHT_FEEDBACK_URL} target="_blank" rel="noopener noreferrer">
      联系我们
    </a>
    移除。
  </>
);